package com.lcy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lcy.dao.UserMapper;
import com.lcy.entity.User;
import com.lcy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {

    /**
     *
     */
    @Autowired
    private UserMapper userMapper;


    public PageInfo  selUserBy(User user, Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        List<User> list = userMapper.selUserBy(user);
        PageInfo<User> pageInfo=new PageInfo<User>(list);

        return pageInfo;
    }

    public PageInfo<User> selAllUserAndOrder(User user, Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        List<User> list = userMapper.selAllUserAndOrder(user);
        PageInfo<User> pageInfo= new PageInfo<User>(list);

        return pageInfo;
    }
}
